package ynu.edu.feign;

import org.springframework.stereotype.Component;
import ynu.edu.entities.BaseResponse;

import java.util.HashMap;
import java.util.Map;

/**
 * 地址服务Feign客户端降级实现
 */
@Component
public class AddressFeignClientFallback implements AddressFeignClient {

    @Override
    public BaseResponse<Map<String, Object>> getAddressById(Integer addressId) {
        Map<String, Object> fallbackData = new HashMap<>();
        fallbackData.put("daId", addressId);
        fallbackData.put("address", "暂无地址信息");
        fallbackData.put("contactName", "暂无联系人");
        fallbackData.put("contactTel", "暂无联系电话");
        return BaseResponse.error(500, "获取地址信息失败，服务不可用");
    }
} 